<html>
<head>
<style>
body{width:300px;background-color:#FFF;border:dashed 2px #FA0;font-size:12px;}
img{border:0}
#webInfo{marging:0 auto;padding:10px;}
.info_name{color:#7B7B7B;font-weight:bold;maring-top:20px;}
.info_detail{color:#7B7B7B;padding-left:20px;line-height:18px;}
.info_detail:hover{background:#D2E1F6;}
a:link,a:visited{text-decoration:none;color:#0080C0;}
.num{color:#6C8C07;}
</style>
<!--
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
-->
<script>
var header = '';
chrome.extension.sendRequest({method:'getWebInfo'}, function(webInfo){
	var info = '<div class="info_name">' + chrome.i18n.getMessage('extPop_local_title') + '</div>' + 
			'<div class="info_detail">' + localStorage['ip'] + ' - ' + localStorage['loc'] + '</div>';
	if (!webInfo)
	{
		info += '<div class="info_name">' + chrome.i18n.getMessage('extPop_noinfo') + '</div>';
	}
	else
	{
		header = webInfo.header.replace(/<br \/>/g, '<br />');
		info += '<div class="info_name">' + chrome.i18n.getMessage('extPop_tabId_title') + ' <span class="num">' + webInfo.id + '</span></div>' +
		'<div class="info_name">' + chrome.i18n.getMessage('extPop_web_title') + '</div>' + 
		'<div class="info_detail"><img src="' + chrome.extension.getURL('servers/') + webInfo.sicon + '.gif" />' +
		' ' + webInfo.server + '</div>' + 
		'<div class="info_detail"><img src="' + chrome.extension.getURL('flags/') + webInfo.flag + '.png" />' +
		' ' + webInfo.ip + ' - ' + webInfo.loc + '</div>' + 
		'<div class="info_detail" id="header_info"><a href="javascript:;" onclick="showHeader()">Header</a></div>';
	}
	document.getElementById('webInfo').innerHTML = info;
	document.getElementById('webInfo').title = chrome.i18n.getMessage('extPop_webInfo_tooltip');
});
function showHeader()
{
	document.getElementById('header_info').innerHTML = header;
}
function autocopy(evt)
{
	//alert(evt.button);
	if(evt.button==0&&document.getSelection()!="")document.execCommand('copy',false,null);
}
window.addEventListener('mouseup', autocopy, false);
</script>
</head>
<body>
<div id="webInfo" title="abc"></div>
</body>
</html>